package cn.springcloudtest.controller;

import cn.springcloudtest.common.Dto;
import cn.springcloudtest.service.LogService;
import cn.springcloudtest.service.TopicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ProjectName:springcloud-topic-consumer
 * @Author:赵伟杰
 * @Date:2021年09月06日 8:49
 */
@Api(value = "微博标题、文章接口",description = "查询微博标题、查询文章接口",tags = "标题文章Controller")
@RestController("/api")
public class TopicController {

    @Resource
    private LogService logService;

    @Resource
    private TopicService topicService;

    @ApiOperation(value = "获取所有标题",notes = "无参数获取所有标题")
    @ApiImplicitParam(name = "无参",value = "",required = false,dataType = "")
    @RequestMapping("/getTopic")
    public Dto getTopic() {
        return topicService.getTopicList();
    }

    @ApiOperation(value = "获取所有动态",notes = "无参数获取所有动态")
    @ApiImplicitParam(name = "无参",value = "",required = false,dataType = "")
    @RequestMapping("/getLog")
    public Dto getLog() {
        return logService.getLogList();
    }


}
